<template>
  <div id="promotion">
    <div class="headline">
      <img src="/img/icon/icon_zhekou.svg" width="30" alt="图片丢失" />
      <h2>Promotion of This Month</h2>
    </div>
    <div class="context">
      <div class="lit_pro">
        <div class="pro_item" v-for="(item, k) in promotion_list" :key="k">
          <a :href="item.link">
            <div class="pro_img">
              <img :src="item.img_url" alt="图片丢失" />
            </div>
            <div class="pro_title">
              <p>{{ item.title }}</p>
            </div>
            <div class="pro_price">
              <h3>US${{ item.price }}</h3>
            </div>
          </a>
        </div>
      </div>
      <div class="big_pro">
        <a :href="big_promotion.link"
          ><img :src="big_promotion.img_url" :alt="big_promotion.link"
        /></a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name:'Promotion',
  data() {
    return {
      promotion_list: [
        {
          img_url: "/img/promotion/SANYO_C-RN113H3C_R407c.jpg",
          link: "javascript:void(0)",
          title: "Sanyo Denki Compressor C-RN113H3C",
          price: "559.00",
        },
        {
          img_url: "/img/promotion/Mitsubishi_RB247YFY.jpg",
          link: "javascript:void(0)",
          title: "Mitsubishi Compressor RB247YFY",
          price: "699.00",
        },
        {
          img_url: "/img/promotion/Tecumseh_TRK5480Y_R134a.jpg",
          link: "javascript:void(0)",
          title: "Tecumseh Compressor TRK5480Y",
          price: "437.00",
        },
        {
          img_url: "/img/promotion/Ebmpapst_4114[N2H3P-309.jpg",
          link: "javascript:void(0)",
          title: "Ebmpapst Fan 4114N/2H3P-309",
          price: "79.00",
        },
        {
          img_url: "/img/promotion/copeland_zrh116kte-tfd-502__1.jpg",
          link: "javascript:void(0)",
          title: "Copeland Compressor ZRH116KTE-TFD-502",
          price: "1899.00",
        },
        {
          img_url: "/img/promotion/Panasonic_MSME042G1U.jpg",
          link: "javascript:void(0)",
          title: "Panasonic Servo Motor MSME042G1U",
          price: "599.00",
        },
        {
          img_url: "/img/promotion/Rexroth_4WE10W3X[CG24N9K4.jpg",
          link: "javascript:void(0)",
          title: "Bosch Rexroth Solenoid Valve 4WE10W3X/CG24N9K4",
          price: "649.00",
        },
        {
          img_url: "/img/promotion/AirTAC_TCM12X30S.jpg",
          link: "javascript:void(0)",
          title: "AirTAC Air Cylinder TCM12X30S",
          price: "89.00",
        },
      ],
      big_promotion: {
        img_url: "/img/promotion/hot-ad.jpg",
        link: "javascript:void(0)",
      },
    };
  },
};
</script>

<style lang="less" scoped>
@import '@/less/color';

#promotion {
  width: 100%;
  margin-bottom: 35px;
}
/* --------- */
.headline {
  height: 30px;
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  h2 {
    margin-left: 5px;
    display: inline-block;
  }
}
/* --------- */
.context {
  display: flex;
  height: 654px;
}

/* ----------- */
.lit_pro {
  width: calc(100% - 352px);
  display: flex;
  align-items:center;
  flex-wrap: wrap;
}

.pro_item {
  width: 25%;
  height: 50%; 
  padding: 10px;
  box-sizing: border-box;
  
  div{
    width: 100%;
    overflow: hidden;
  }
  a{
    display: inline-block;
    box-sizing: border-box;
    background: white;
    border-radius: 5px;
    padding: 10px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: black;
  }
  p{
    display: -webkit-box;
    overflow: hidden;
    margin: 10px 0;
    height: 35px;
    text-overflow: ellipsis;
    word-break: break-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  img{
    height: 195px;
  }
}
.pro_img{
  display: flex;
  justify-content: center;
}
.pro_title{
  font-size: 10px;
}
.pro_item>a:hover{
  .pro_title{
    color: @color-primary;
  }
  outline: 1px solid @color-primary;
}
/* ----------- */
.big_pro {
  box-sizing: border-box;
  background: white;
  border-radius: 5px;
  margin: 10px;
  width: 352px;
  height: 634px;
  padding: 12px;
  img {
    width: 328px;
    height: 610px;
  }
}
@media screen and (min-width: 760px) and (max-width: 1280px) {
  .lit_pro{
    width: 100%;
  }
  .big_pro{
    display: none;
  }
}
@media screen and (max-width: 760px) {
  .lit_pro{
    width: 100%;
  }
  .big_pro{
    display: none;
  }
  .context{
    height: 1308px;
  }
  .pro_item{
    width: 50%;
    height: 25%;
  }
}
</style>